home *** CD-ROM | disk | FTP | other *** search
- #ifndef NULLAXADDR
-
- #include "global.h"
-
- /* AX.25 datagram (address) sub-layer definitions */
-
- #define NAXROUTE 5 /* Number of hash chains in routing table */
- #define MAXDIGIS 7 /* Maximum number of digipeaters */
- #define ALEN 6 /* Number of chars in callsign field */
- #define AXALEN 7 /* Total AX.25 address length, including SSID */
-
- /* Internal representation of an AX.25 address */
- struct ax25_addr {
- char call[ALEN];
- char ssid;
- #define SSID 0x1e /* Sub station ID */
- #define REPEATED 0x80 /* Has-been-repeated bit in repeater field */
- #define E 0x01 /* Address extension bit */
- #define C 0x80 /* Command/response designation */
- };
- #define NULLAXADDR (struct ax25_addr *)0
- /* Our AX.25 address */
- extern struct ax25_addr Mycall;
-
- /* AX.25 broadcast address: "QST -0" in shifted ASCII */
- extern struct ax25_addr Ax25_bdcst;
-
- /* Internal representation of an AX.25 header */
- struct ax25 {
- struct ax25_addr dest; /* Destination address */
- struct ax25_addr source; /* Source address */
- struct ax25_addr digis[MAXDIGIS]; /* Digi string */
- int ndigis; /* Number of digipeaters */
- int cmdrsp; /* Command/response */
- };
-
- /* C-bit stuff */
- #define UNKNOWN 0
- #define COMMAND 1
- #define RESPONSE 2
-
- /* AX.25 routing table entry */
- struct ax_route {
- struct ax_route *prev; /* Linked list pointers */
- struct ax_route *next;
- struct ax25_addr target;
- struct ax25_addr digis[MAXDIGIS];
- int ndigis;
- char type;
- #define AX_LOCAL 1 /* Set by local ax25 route command */
- #define AX_AUTO 2 /* Set by incoming packet */
- };
- #define NULLAXR ((struct ax_route *)0)
- extern struct ax_route *Ax_routes[NAXROUTE];
-
- /* AX.25 Level 3 Protocol IDs (PIDs) */
- #define PID_SEGMENT 0x08 /* Segmentation fragment */
- #define PID_IP 0xcc /* ARPA Internet Protocol */
- #define PID_ARP 0xcd /* ARPA Address Resolution Protocol */
- #define PID_NETROM 0xcf /* NET/ROM */
- #define PID_NO_L3 0xf0 /* No level 3 protocol */
-
- #define SEG_FIRST 0x80 /* First segment of a sequence */
- #define SEG_REM 0x7f /* Mask for # segments remaining */
-
- #if defined(__STDC__) || defined(__TURBOC__)
-
- struct ax25_cb *open_ax25(struct iface *,struct ax25_addr *,struct ax25_addr *,
- int16,void (*)(),void (*)(),void (*)(),int user);
- int send_ax25(struct ax25_cb *axp,struct mbuf *bp,int pid);
- struct mbuf *recv_ax25(struct ax25_cb *axp,int16 cnt);
- int ax25val(struct ax25_cb *axp);
- int kick_ax25(struct ax25_cb *axp);
- int reset_ax25(struct ax25_cb *axp);
- struct ax25_cb *find_ax25(struct ax25_addr *);
- int ax_send(struct mbuf *bp,struct iface *iface,int32 gateway,int prec,
- int del,int tput,int rel);
- int ax_output(struct iface *iface,char *dest,char *source,int16 pid,
- struct mbuf *data);
- struct ax_route *ax_lookup(struct ax25_addr *);
- struct ax_route *ax_add(struct ax25_addr *,int,struct ax25_addr *,int);
- int ax_drop(struct ax25_addr *);
- int sendframe(struct ax25_cb *axp,int cmdrsp,int ctl,struct mbuf *data);
- void axarp(void);
- struct mbuf *segmenter(struct mbuf *bp,int16 ssize);
- void s_arcall(),s_atcall(),s_ascall();
- void st_ax25();
- int ax_recv(struct iface *,struct mbuf *);
- #else
- struct mbuf *recv_ax25();
- struct ax25_cb *open_ax25(),*find_ax25();
- int ax_send(),ax_output();
- struct ax_route *ax_lookup(),*ax_add();
- int ax_drop();
- int sendframe();
- void axarp();
- struct mbuf *segmenter();
- void s_arcall(),s_atcall(),s_ascall();
- void st_ax25();
- int ax_recv();
- #endif
-
- #endif /* NULLAXADDR */
-